﻿@model PagedInfo<ViewContentAndCate>
@inject ContentService articleService
@inject ContentCateService contentCateService
@{
    ViewData["Title"] = ViewBag.cateInfo.Name;
    ViewData["SiteName"] = await SystemConfig.GetByFieldNameAsync("SiteName");
    ViewData["Description"] = await SystemConfig.GetByFieldNameAsync("Description");
    Layout = null;
}
<!doctype html>
<html lang="zh-cn">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="@ViewData["Description"]">
    <meta name="author" content="Cdeng">
    <title>@ViewData["Title"]</title>
    <link href="~/lib/layui/css/layui.css" rel="stylesheet">
    <link href="~/home/css/main.css" rel="stylesheet">
    <link href="~/home/css/list.css" rel="stylesheet">
</head>
<body>
    @if (ViewBag.cateInfo.BannerHeader != null && ViewBag.cateInfo.BannerHeader != "")
    {
        <style>
            body { width: 100%; min-height: 100%; background: url("@ViewBag.cateInfo.BannerHeader") top center no-repeat #fff; }
            .cxuu-list-margintop { margin-top: @ViewBag.cateInfo.BannerLit; }
        </style>
    }

    <div class="layui-container cxuu-list-margintop" >
        <ul class="layui-nav" lay-filter="">
            <li class="layui-nav-item"><a asp-area="" asp-controller="Home" asp-action="Index" style="font-size:22px;">琪耀</a></li>

            @foreach (var item in await contentCateService.CateListByIdAsync(new int[] { 1, 2, 3, 6, 4, 8 }))
            {
                <li class="layui-nav-item">
                    <a asp-area="Home" asp-controller="List" asp-action="Index" asp-route-id="@item.Id" class="nav-link">@item.Name</a>
                </li>
            }

            <li class="layui-nav-item">
                <a asp-area="Home" asp-controller="Video" asp-action="Index" class="nav-link">视频</a>
            </li>

            <li class="layui-layout-right layui-hide-xs" style="padding-top:10px;">
                <form asp-controller="Search" asp-action="Index" method="get">
                    <div class="layui-col-md7">
                        <input type="text" name="keyword" lay-verify="title" autocomplete="off" placeholder="请输入标题" class="layui-input">
                    </div>
                    <div class="layui-col-md5">
                        <button type="submit" class="layui-btn layui-btn-normal" lay-submit="" lay-filter="submittitle"><i class="layui-icon">&#xe615;</i> Search </button>
                    </div>
                </form>
            </li>

        </ul>
    </div>

    <div class="layui-container" style="margin-top:10px;">
        <div class="layui-row layui-col-space15">
            <div class="layui-col-md12">
                <div class="layui-panel" style="text-align:left;padding:10px;">
                    <span class="layui-breadcrumb">
                        <a href="/">Home</a>
                        <a><cite>@ViewBag.cateInfo.Name</cite></a>
                    </span>
                </div>
            </div>
        </div>
    </div>

    <div class="layui-container">
        <div class="layui-row layui-col-space15">
            <div class="layui-col-md8">
                <div class="layui-row layui-col-space15">
                    <div class="layui-col-md12">
                        <div class="layui-panel cxuu-list-list" style="padding:5px;">
                            <ul>
                                @{
                                    int i = 1;
                                    @foreach (var item in Model.Result)
                                    {
                                        <li>
                                            <span class="layui-badge-dot layui-bg-blue"></span>
                                            <span class="cxuu-list-time">@item.Time.ToString("yyyy-MM-dd")</span>
                                            <a asp-area="Home" asp-controller="Info" asp-action="Index" asp-route-id="@item.Id" target="_blank">@item.Title </a>
                                        </li>
                                        if (i % 5 == 0)
                                        {
                                            <li> <hr class="layui-bg-gray"></li>
                                        }
                                        i++;
                                    }
                                }
                            </ul>
                            <div id="laypage"></div>
                        </div>

                    </div>

                </div>
            </div>
            <div class="layui-col-md4">
                <div class="layui-panel cxuu-list-list" style="padding:5px;">
                    <div class="layui-card">
                        <div class="layui-card-header">推荐阅读</div>
                        <div class="layui-card-body">
                            <ul>
                                @foreach (var item in await articleService.QyList(new() { Cids =null, Limit = 10, CacheName = "calist-right2" }))
                                {
                                    <li>
                                        <span class="layui-badge-dot layui-bg-green cxuu-dot-4x4"></span>
                                        <a asp-area="Home" asp-controller="Info" asp-action="Index" asp-route-id="@item.Id" class="nav-link">@StringUtility.Trim(item.Title, 18)</a>
                                    </li>
                                }
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <partial name="_Footer" />
    <script src="~/lib/layui/layui.js"></script>
    <script>
        layui.use(['laypage', 'element', 'layer'], function () {
            var laypage = layui.laypage
                , layer = layui.layer
                , element = layui.element;

            laypage.render({
                elem: 'laypage'
                , count: '@Model.TotalNum'
                , limit: '@Model.PageSize'
                , groups: '@Model.TotalPage'
                , theme: '#1E9FFF'
                , curr: '@Model.PageIndex'
                //,hash: '/' //自定义hash值
                , prev: "上一页"
                , next: "下一页"
                , jump: function (obj, first) {
                    if (!first) {
                        location.href = '/Home/List/Index/@ViewBag.cateInfo.Id?page=' + obj.curr;
                    }
                }
            });
        });
    </script>
</body>
</html>